<template>
<div>
  <van-nav-bar
      title="打卡记录"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
  />
  <van-list
      v-model:loading="loading"
      :finished="finished"
      @load="onLoad"
  >
    <van-swipe-cell  v-for="a in clickInRecords" >
      <van-cell :title="a.userId" :value="'描述：'+a.content" :label="a.nums+'天'"/>
      <van-cell  :title="a.tittle"  :value="+a.status==0?'已完成打卡':'未完成打卡'" :label="a.addAt"/>
    </van-swipe-cell>
  </van-list>

</div>
</template>

<script setup>
import {ref} from "vue";
import {get} from "../../util/request.js";
import {showToast} from "vant";
const clickInRecords =ref([])//全部数据
const onClickLeft = () => history.back();
const loading = ref(false);
const finished = ref(false);

const onLoad = () => {
  // 发起axios 请求 刷新
  // onCourse();
  get("home/checkins/clickInRecord").then( r=>{
    if (r.code == 0){ // 获取成功
      // alert("查询成功")
      clickInRecords.value= r.data;
      loading.value = false;
      finished.value = true;
    }else {
      showToast("查询失败")
      // 加载状态结束
    }
  }).catch(function (){
    alert("用户信息查询异常")
  });
}
</script>

<style scoped>

</style>